﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QLNHASACH.BussinessLayer;
using QLNHASACH.DataAccessLayer;
//
using QLNHASACH.BussinessLayer.ObjectBUS;

namespace QLNHASACH
{
    public partial class fmMain : Form
    {
        
        public fmMain()
        {
            InitializeComponent();
            customListBox1.ItemClick += new PresentationLayer.SearchCtrl.ListBoxKH.sukien(customListBox1_ItemClick);
        }
        DataTable table=new DataTable();
        void customListBox1_ItemClick()
        {
            richTextBox1.Text = customListBox1.SelectedItem.Hoten + "\n" + customListBox1.SelectedItem.Email;
        }
        private void buttonBar1_ItemClick(object sender, Janus.Windows.ButtonBar.ItemEventArgs e)
        {
            Sach.SelectedIndex = int.Parse(btBar.SelectedItem.Key);
            
        }

        private void dangNhapCtrl1_VisibleChanged(object sender, EventArgs e)
        {

        }

        private void Thoát_Click(object sender, EventArgs e)
        {
            Sach.SelectedIndex = 0;
        }

        private void fmMain_Load(object sender, EventArgs e)
        {
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            //DataTable table= DataAccess.SearchKH(textBox1.Text);
            table= KhachHangBUS.LayDSKhachHang();
            if (customListBox1 == null)
            {
                customListBox1.Datasource = table;
            }
            else
            {
                customListBox1.Datasource = null;
                customListBox1.Datasource = table;
            }
        }
    }
}
